package com.fowo.api.model.process.product;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import com.fowo.api.common.validator.EnumsString;
import javax.validation.constraints.*;
import lombok.Getter;
import lombok.Setter;

/** 加工单 导入导出辅助模型 */
@Getter
@Setter
public class ProcessProductExcelPo {

  @Size(max = 500, message = "单号长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "单号")
  private String processSn;

  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "供应商")
  private String supplierSupplierName;

  @ExcelIgnore
  @ExcelProperty(value = "供应商")
  private Long supplier;

  @DateTimeFormat("yyyy年MM月dd日HH:mm:ss")
  @ExcelProperty(value = "加工日期")
  private java.util.Date pdate;

  @NotNull(message = "仓库不能为空")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "*仓库")
  private String widName;

  @ExcelIgnore
  @ExcelProperty(value = "*仓库")
  private Long wid;

  @NotBlank(message = "单据类型不能为空")
  @EnumsString(
    value = { "加工单" },
    message = "单据类型的可用值为 “加工单” 其中之一"
  )
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "*单据类型")
  private String type;

  @EnumsString(
    value = { "草稿", "已提交" },
    message = "状态的可用值为 “草稿”, “已提交” 其中之一"
  )
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "状态")
  private String status;

  @EnumsString(
    value = { "未推送", "失败", "成功" },
    message = "推送应付单的可用值为 “未推送”, “失败”, “成功” 其中之一"
  )
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "推送应付单")
  private String generateAp;

  @Size(max = 500, message = "备注长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "备注")
  private String remarks;

  @Size(max = 50, message = "入库单长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "入库单")
  private String whid;

  @Size(max = 50, message = "入库单号长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "入库单号")
  private String wcode;
}
